package com.study.demo01.err;

import lombok.Data;
import lombok.RequiredArgsConstructor;

import java.util.concurrent.locks.ReentrantLock;

/**
 * @author zhuzi
 * 2023/9/7 15:43
 */
public class Demo02 {
    @Data
    @RequiredArgsConstructor
    public static class Item {
        private final String name;
        int remaining = 100;
        ReentrantLock lock = new ReentrantLock();
    }

   /* private List<Item> createCart() {
        return IntStream.rangeClosed(1, 3)
                .mapToObj(i -> "item" + ThreadLocalRandom.current().nextInt(items.size()))
                .map(name -> items.get(name)).collect(Collectors.toList());
    }*/
}
